#pragma once

#include <iostream>
using namespace std;
#include <string>
#include <queue>
#include <pthread.h>
#include <unistd.h>

class Task
{
public:

    Task()
    {}
    
    Task(int a, int b, char op)
        : _a(a), _b(b), _op(op)
    {
    }

    void run()
    {
        switch (_op)
        {
        case '+':
            cout << "线程ID:" << pthread_self() << " 处理任务：" << _a << _op << _b << "=" << (_a + _b) << endl;
            break;
        case '-':
            cout << "线程ID:" << pthread_self() << " 处理任务：" << _a << _op << _b << "=" << (_a - _b) << endl;
            break;
        case '*':
            cout << "线程ID:" << pthread_self() << " 处理任务：" << _a << _op << _b << "=" << (_a * _b) << endl;
            break;
        case '/':
            cout << "线程ID:" << pthread_self() << " 处理任务：" << _a << _op << _b << "=" << (_a / _b) << endl;
            break;
        case '%':
            cout << "线程ID:" << pthread_self() << " 处理任务：" << _a << _op << _b << "=" << (_a % _b) << endl;
            break;
        default:
            break;
        }
    }

    ~Task()
    {
    }

private:
    int _a;
    int _b;
    char _op;
};